<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单疑问</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="css/mui.min.css" rel="stylesheet" />
    <!--<link href="css/loading.css" rel="stylesheet" />-->
    <link rel="stylesheet" href="css/antui.min.css"/>
</head>
<body>
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-pull-left"></a>
        <h1 class="mui-title">订单疑问</h1>
        <span class="mui-icon mui-icon-close mui-pull-right" onclick="window.history.go(-3);"></span>
    </header>

    <div class="mui-content" >
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right not-arrival">
                    <span style="color: #333;">刷卡未到账？</span>
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right progress">
                    <span style="color: #333;">到账进度查询</span>
                </a>
            </li>
        </ul>
    </div>
    <div class="mui-popup-backdrop mui-active" style="display: none; background-color: transparent;">
        <div class="am-toast">
            <div class="am-toast-text">
                <span class="am-icon toast loading"></span> 查询中
            </div>
        </div>
    </div>
    <!--<div class="loading">s-->
        <!---->
    <!--</div>-->
    <script src="js/mui.min.js"></script>
    <script src="js/app.js"></script>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script>
        var orderNum = null;
        var amount = null;
        var summary = null;
        mui.init({
            swipeBack: true //启用右滑关闭功能
        });
        mui.ready(function () {
            orderNum = getUrlParam('orderNum');
            amount = getUrlParam('amount');
            summary = getUrlParam('summary');
        });
        mui(document.body).on('tap','.not-arrival',function () {
//            orderNum = 'KQ35306241292831';
            $('.mui-popup-backdrop').css('display','block');
            $.ajax({
                url:"/thmlfApi/avs/pay/transferquery?orderNum="+orderNum+"&_d="+Date.parse(new Date()),
                success:function (r) {
                    $('.mui-popup-backdrop').css('display','none');
                    if (r.code == 20002){
                        mui.alert(r.message);
                    }else {
                        rePay(r.code);
                    }
                },
                error:function (e) {
                    $('.mui-popup-backdrop').css('display','none');
                    mui.alert("请求失败，请稍后重试");
                }
            });
        });
        mui(document.body).on('tap','.progress',function () {
            window.location.href = 'progress.html?orderNum='+orderNum;
        });
        function rePay(code) {
            window.location.href = 'deposit-result.html?code='+code+"&orderNum="+orderNum+"&amount="+amount+"&summary="+summary+"&_d="+Date.parse(new Date());
//            mui.confirm("此订单结算失败，是否发起重新结算？", "提示", ["确定", "取消"],function (obj) {
//                if (obj.index == 0){
//                    mui.alert('a');
//                }
//            });
        }
    </script>
</body>
</html>